package homework;

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.Scanner;

public class Date {
    //1. 编写一个函数，实现日期格式化处理.
    public static void main(String[] args) {
        Scanner sc =new Scanner(System.in);
        System.out.println("请输入日期（格式为：年-月-日）：");
        String a  =sc.next();
        LocalDate localDate =LocalDate.parse(a);
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy年MMMd日");
        String text = localDate.format(formatter);
        System.out.println("转换为："+text);
    }
}
